import React, { Component } from 'react';
import {
  View,
  Text,
  StyleSheet,
} from 'react-native';
import SearchBar from '../components/SearchBar';
import * as defaultStyles from '../constants/DefaultStyles';
import { Actions } from 'react-native-router-flux';

export default class SearchContainer extends Component {
  constructor(props) {
    super(props);
    this.state = {
      searchContent: '无搜索内容',
    }
  }
  render() {
    return (
      <View style={styles.container}>
        <SearchBar leftImage="angle-left" leftClick={() => Actions.pop()}
                   rightClick={(text) => this.setState({searchContent: text})}/>
        <View style={styles.searchContent}>
          <Text>{this.state.searchContent}</Text>
        </View>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  searchContent: {
    flex: 1,
    backgroundColor: defaultStyles.WHITEOFBACKGROUND,
    justifyContent: 'center',
    alignItems: 'center',
  }
});